package com.yhb.hash;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;

public class Main {

    public static void main(String[] args) {

    }

    public static void test01() {
        try {
            FileInputStream fileInputStream=
                    new FileInputStream("D:/filedemo/text.txt");
            FileOutputStream fileOutputStream=new FileOutputStream("D:/filedemo/text.txt",true);
            byte[] bytes=new byte[1024];
            int len=0;
            do{
                bytes=new byte[1024];
                len=fileInputStream.read(bytes);
                if (len!=-1){
                    String str=new String(bytes);
                    System.out.println(str);

                    fileOutputStream.write(bytes,0,len);
                }
            }while(len !=-1);

        } catch (Exception e) {
            e.printStackTrace();
        }finally {

        }
    };
}
